package com.portal4kids.view;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.portal4kids.controller.PeopleManager;
import com.portal4kids.model.People;
import com.portal4kids.model.PeopleAttributes;
import com.portal4kids.model.PeopleVisitPlan;

public class PeopleAction extends ActionSupport{
	private PeopleManager linkController;
	private People people;
	private List<People> peoplesList;
	private PeopleAttributes attributes;
	private PeopleVisitPlan plan;
	private List<PeopleVisitPlan> visitPlanList;
	private int id_people;
	
	
	
	public PeopleAction(){
		linkController = new PeopleManager();
	}
	public String execute(){
		//placesList = linkController.placesList();
		return SUCCESS;		
	}
	
	public String savePeople(){
		people = linkController.savePeople(getPeople(), getAttributes());
		return SUCCESS;		
	}
	
	public String searchPeople(){
		peoplesList = linkController.getPeopleAfterType(getPeople(), getAttributes());
		return SUCCESS;	
	}
	
	public String editPlan(){
		linkController.editVisitPlan(getPlan(), getId_people());
		return SUCCESS;	
	}
	
	public People getPeople() {
		return people;
	}
	public void setPeople(People people) {
		this.people = people;
	}
	public List<People> getPeoplesList() {
		return peoplesList;
	}
	public void setPeoplesList(List<People> peoplesList) {
		this.peoplesList = peoplesList;
	}
	public PeopleAttributes getAttributes() {
		return attributes;
	}
	public void setAttributes(PeopleAttributes attributes) {
		this.attributes = attributes;
	}
	public PeopleVisitPlan getPlan() {
		return plan;
	}
	public void setPlan(PeopleVisitPlan plan) {
		this.plan = plan;
	}
	
	public List<PeopleVisitPlan> getVisitPlanList() {
		return visitPlanList;
	}
	public void setVisitPlanList(List<PeopleVisitPlan> visitPlanList) {
		this.visitPlanList = visitPlanList;
	}
	public int getId_people() {
		return id_people;
	}
	public void setId_people(int id_people) {
		this.id_people = id_people;
	}
	
	
	
	
}
